﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Facebook;

namespace FeedBack.Model {
    public partial class Story {
        public Story() { }
        public Story(JsonObject json) {
            Copy(json);
        }

        public void Copy(JsonObject json) {
            this.Author = json.Get("from").Get<string>("name");
            this.CommentCount = json.Get<int>("comment_count");
            this.CreatedTime = json["created_time"].ToDateTime();
            this.Description = json.Get<string>("description");
            this.LikeCount = json.Get<int>("like_count");
            this.Link = json.Get<string>("link");
            this.Message = json.Get<string>("message");
            this.ObjectId = json.Get<string>("object_id");
            this.Picture = json.Get<string>("picture");
            this.SharedCount = (int)json.Get("shares").Get<long>("count");
            this.Source = json.Get<string>("source");
            this.StatusType = json.Get<string>("status_type");
            this.StoryId = json.Get<string>("id");
            this.StoryText = json.Get<string>("story");
            this.Thumbnail = json.Get<string>("");
            this.Type = json.Get<string>("type");
            this.UpdatedTime = json["updated_time"].ToDateTime();
            this.Caption = json.Get<string>("caption");
        }
    }
}
